package bento.views.frms;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import bento.IHasWrapper;
import bento.IWrapper;
import bento.views.pnls.PnlMain;
import bento.views.pnls.PnlMain.Wrapper;

public class FrmMain extends JFrame implements IHasWrapper<FrmMain.Wrapper> {

    private Wrapper wrapper;
    
    private JPanel contentPane;
    private PnlMain pnlMain;

    @Override
    public Wrapper getWrapper() {
        return wrapper;
    }
    
    /**
     * Create the frame.
     */
    public FrmMain() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 568, 387);
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        contentPane.setLayout(new BorderLayout(0, 0));
        setContentPane(contentPane);
        
        pnlMain = new PnlMain();
        contentPane.add(pnlMain, BorderLayout.CENTER);
    }
    
    

    public class Wrapper implements IWrapper<Component> {
        private PnlMain.Wrapper panels;
        
        public void show() {
            FrmMain.this.setVisible(true);
        }
        
        public PnlMain.Wrapper getPanels() {
            return panels;
        }

        @Override
        public Component get() {
            return FrmMain.this;
        }
        
        public Wrapper(bento.api.IBentoClient bentoClient) {
            FrmMain.this.wrapper= this;
            panels= pnlMain.new Wrapper(bentoClient);
        }
    }

}
